﻿@model equinoxWeb.Models.Caso
@{
    ViewBag.Title = "Detalle caso";
    Layout = (ViewBag.esCliente!=null && ViewBag.esCliente?"~/Views/Shared/_ClienteLayout.cshtml":"~/Views/Shared/_Layout.cshtml");
}
@using equinoxWeb.Models;
<!-- content -->
<script src="/Scripts/caso.js"></script>
<form class="form-horizontal" name="detailsForm" method="get">
    <fieldset>
        <legend>@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Información del caso":"Case information")</legend>
    </fieldset>
    @Html.HiddenFor(model => model.IdCaso)
    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="NReferencia">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Número de referencia":"Reference ID"):</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.NReferencia
        </div>
    </div>

    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="Anho">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Año de ejecución":"Realization year"):</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.Anho
        </div>
    </div>

    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="Cliente.IdCliente">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Cliente":"Client"):</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.Cliente.RazonSocial
        </div>
    </div>

    @if (Model.Club != null && Model.Club.IdClub != 0){
    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="Cliente.IdCliente">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Club":"Club"):</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.Club.Nombre
        </div>
    </div>
    }

    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="Inspector">Inspector:</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.Inspector
        </div>
    </div>

    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="Location">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Ubicación":"Location"):</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.Location
        </div>
    </div>

    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="Ship">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Nave":"Ship"):</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.Ship
        </div>
    </div>
    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="Agente">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Agente":"Agent"):</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.Agente
        </div>
    </div>

    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="Ruc">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Contenido":"Abstract"):</label>
        <div class="col-md-3 col-sm-6">
            @Html.TextAreaFor(model => model.Content, new { @class = "form-control", @disabled = "disabled" })
        </div>
    </div>

        <div class="form-group">
            <label class="col-md-4 col-sm-6 control-label" for="ClubPandI">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Club PandI":"PandI club"):</label>
            <div class="col-md-3 col-sm-6">
                @Html.TextAreaFor(model => model.ClubPandI, new { @class = "form-control", @disabled = "disabled"  })
            </div>
        </div>

        <div class="form-group">
            <label class="col-md-4 col-sm-6 control-label" for="Observaciones">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Observaciones":"Notes"):</label>
            <div class="col-md-3 col-sm-6">
                @Html.TextAreaFor(model => model.Observaciones, new { @class = "form-control", @disabled = "disabled"  })
            </div>
        </div>

    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="ETA">ETA:</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.ETA
        </div>
    </div>
    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="FechaNominacion">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Fecha de nominación":"Nomination date"):</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.FechaNominacion
        </div>
    </div>

    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="FechaInicio">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Fecha de inicio":"Starting date"):</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.FechaInicio
        </div>
    </div>

    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="FechaFin">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Fecha de fin programada":"Scheaduled ending date"):</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.FechaFin
        </div>
    </div>

    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="TipoCaso.IdTipoCaso">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Tipo de caso":"Scope"):</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.TipoCaso.Descripcion
        </div>
    </div>

    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="IdUsuario">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Encargado del caso":"Person in charge"):</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.Usuario.Nombre
        </div>
    </div>
    <div class="form-group">
        <label class="col-md-4 col-sm-6 control-label" for="IdUsuario">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Estado del caso":"Status"):</label>
        <div class="col-md-3 col-sm-6 form-control-static">
            @Model.EstadoCaso.Descripcion
        </div>
    </div>
    <br />
    <div class="form-group">
        <div class="col-md-3 col-sm-6">
        </div>
    </div>
    <div class="form-group">
        @if (Model.EstadoCaso.IdEstadoCaso == Constantes.EstadoAbierto)
        {
            if (!ViewBag.esCliente){
                <button type="button" onclick="javascript:CerrarCaso(document.detailsForm)" class="btn btn-large btn-primary">Cerrar caso</button> 
            }
        }
        <button type="button" onclick="javascript:ListCostDocuments(document.detailsForm)" class="btn btn-large btn-primary">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Ver costos":"Cost documents")</button>&nbsp;
        @if (!ViewBag.esCliente){
                <button type="button" onclick="javascript:ListarTareas(document.detailsForm)" class="btn btn-large btn-primary">Ver tareas</button> 
                <button type="button" onclick="javascript:EditarCaso(document.detailsForm)" class="btn btn-large btn-primary">Editar</button> 
        }
        <a href="../Archivo/Lista?idCaso=@Model.IdCaso" class="btn btn-primary btn-large" role="button">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Ver Archivos":"Files")</a>&nbsp;
        <button type="button" class="btn btn-large" onclick="javascript:history.back();">@(ViewBag.lang==null || ViewBag.lang == "ES" ? "Atras":"Back")</button>

    </div>
</form>
<!-- / content -->
